<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>显示过滤/排序结果</title>
  <link rel="stylesheet" href="">
  <script type="text/javascript" src="../../js/vue.js"></script>
</head>

<body>
<h1>显示过滤/排序结果</h1>
  <ul id="todo-list">
    <li v-for="item in evenNumbers" >{{ item }}</li>
  </ul>
  <script type="text/javascript">
  var key = new Vue({
    el: "#todo-list",
    data: {

        numbers:[1,2,3,4,5,6,7,8,9,10]
    },
    computed:{
      evenNumbers:function(){

        return this.numbers.filter(function(number){

          return number % 2 === 0
        });
      }
    }

  });
  </script>
</body>

</html>
